package com.lonelylang;

//import com.lonelylang.es.api.LoginInfoApi;
//import com.lonelylang.es.api.UserTrackingApi;
//import com.lonelylang.es.dao.LoginInfoDao;
//import com.lonelylang.es.dao.UserTrackingDao;
//import com.lonelylang.init.InitIndex;
//import com.lonelylang.redis.RedisConfig;
//import com.lonelylang.redis.RedisUtil;
import com.lonelylang.core.factory.DataProcessTemplate;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

import java.lang.reflect.InvocationTargetException;

@SpringBootApplication(scanBasePackages = {
		"com.lonelylang.core.*",
		"com.lonelylang.databases.*"})
//@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,classes = {
//		InitIndex.class, LoginInfoApi.class, UserTrackingApi.class,
//		LoginInfoDao.class, UserTrackingDao.class, RedisConfig.class, RedisUtil.class
//})})
public class DataProcessApplication {

	public static void main(String[] args) {
		ApplicationContext context=SpringApplication.run(DataProcessApplication.class, args );
		DataProcessTemplate executeFactory = context.getBean(DataProcessTemplate.class);
		try {
			String message="{\"data\":[{\"id\":\"59\",\"login_account\":\"wendy.wang\",\"account_type\":\"2\",\"region\":null,\"organize\":\"商务拓展部\",\"login_time\":\"2021-08-30 18:26:00\",\"login_state\":\"1\",\"login_message\":\"登录成功\",\"employee_id\":\"10121\"}],\"database\":\"bpm\",\"es\":1642499513000,\"id\":913,\"isDdl\":false,\"mysqlType\":{\"id\":\"int(50)\",\"login_account\":\"varchar(150)\",\"account_type\":\"int(5)\",\"region\":\"varchar(100)\",\"organize\":\"varchar(100)\",\"login_time\":\"datetime\",\"login_state\":\"int(5)\",\"login_message\":\"varchar(255)\",\"employee_id\":\"int(50)\"},\"old\":[{\"account_type\":\"222\"}],\"pkNames\":[\"id\"],\"sql\":\"\",\"sqlType\":{\"id\":4,\"login_account\":12,\"account_type\":4,\"region\":12,\"organize\":12,\"login_time\":93,\"login_state\":4,\"login_message\":12,\"employee_id\":4},\"table\":\"login_info\",\"ts\":1642499513461,\"type\":\"UPDATE\"}";

			boolean exu = executeFactory.analysis(message);


		} catch (ClassNotFoundException e) {

			e.printStackTrace();
		} catch (IllegalAccessException e) {

			e.printStackTrace();
		} catch (InstantiationException e) {

			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		} catch (Throwable e) {
			e.printStackTrace();
		}
	}

}
